//
//  main.c
//  c书3.2 逻辑运算
//
//  Created by mac on 2022/3/21.
//

#include <stdio.h>

int main(void) {
    int i, n, digit = 0, letter = 0, other = 0;
    char ch;
    printf("Enter n:");
    scanf("%d", &n);
    getchar();
    printf("Enter %d characters:", n);
    for (i = 1; i <= n; i++) {
        ch = getchar();
        if ((ch >= '0' && ch <= '9')) {
            digit++;
        } else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {
            letter++;
        } else {
            other++;
        }
    }
    printf("letter=%d digit=%d other=%d", letter, digit, other);
    return 0;
}
